﻿using Newtonsoft.Json;
using System.Collections.Generic;

namespace AutomationCommand
{
    public class ml_connect : BasiCommand
    {
        [JsonProperty("capabilitys")]
        public List<CapabilityItem> Capabilities { get; set; }

        public ml_connect()
        {
            FunctionType = "ml_connect";
            OtherName = "连接手机";
            Capabilities = new List<CapabilityItem>
            {
                new CapabilityItem { Key = "platformName", Value = "Android" },
                new CapabilityItem { Key = "appPackage", Value = "com.taobao.taobao" },
                new CapabilityItem { Key = "appActivity", Value = "com.taobao.tao.welcome.Welcome" },
                new CapabilityItem { Key = "noReset", Value = "True" },
                new CapabilityItem { Key = "fullReset", Value = "False" }
            };
            SuccessJump = -1;
            FailureJump = -1;
        }

        public bool Execute()
        {
            // 在这里编写执行命令的逻辑
            // 返回执行结果
            return true; // 假设此处始终成功
        }
    }

    public class CapabilityItem
    {
        [JsonProperty("k")]
        public string Key { get; set; }

        [JsonProperty("v")]
        public string Value { get; set; }
    }
}
